// cover some element-ui styles
@use "element-plus/theme-chalk/src/index.scss" as *;

.el-upload {
  input[type="file"] {
    display: none !important;
  }
}

.el-upload__input {
  display: none;
}

// to fixed https://github.com/ElemeFE/element/issues/2461
.el-dialog {
  transform: none;
  left: 0;
  position: relative;
  margin: 0 auto;
}

// refine element ui upload
.upload-container {
  .el-upload {
    width: 100%;

    .el-upload-dragger {
      width: 100%;
      height: 200px;
    }
  }
}

// dropdown
.el-dropdown-menu {
  a {
    display: block;
  }
}

// to fix el-date-picker css style
.el-range-separator {
  box-sizing: content-box;
}

.el-scrollbar__view {
  height: 100%;
}
/*扩展样式*/
.el-container {
  height: 100% !important;
  border: 1px solid #eee;
}

.el-input {
  //颜色覆盖
  --el-input-focus-border-color: var(--el-color-success) !important;
  //输入框
  .el-input__wrapper {
    width: 100%;
  }
  .el-input-group__append {
    > .el-button {
      display: flex;
      align-content: center;
    }
  }
}

//按钮
.el-button {
  //     --el-button-text-color: var(--el-color-success);
  //     --el-button-bg-color: var(--el-color-success-light-9);
  //     --el-button-border-color: var(--el-color-success-light-5);
  //     --el-button-hover-text-color: var(--el-color-white);
  //     --el-button-hover-bg-color: var(--el-color-success);
  //     --el-button-hover-border-color: var(--el-color-success);
  //     --el-button-active-text-color: var(--el-color-white);
  &:is(.is-plain, .is-link, .is-text) {
    --el-button-bg-color: var(--el-bg-color) !important;
    --el-button-hover-bg-color: var(--el-color-success-light-9) !important;
    --el-button-hover-text-color: var(--el-color-success) !important;
  }
}

//卡片
.el-card {
  border-radius: 0.63rem;
  &:is(.is-always-shadow) {
    box-shadow: var(--box-shadow) !important;
  }
  &:not(.el-card-bottom-top) {
    display: flex;
    flex-direction: column;
    height: 100%;
    .el-card__body {
      flex: 1;
    }
  }
  .el-card__header {
    height: 3.1rem;
    flex-basis: 3.1rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  --el-card-padding: 0.5rem !important;
}

//表单
.el-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  .el-form-item__label {
    font-weight: 500;
  }
  .el-form-item {
    width: 100%;
    .el-form-item__content {
      .el-input-number {
        input {
          text-align: left;
        }
      }
    }
    .el-button {
      display: flex;
    }
  }
  .el-card {
    flex: 1;
    width: 100%;
  }
  &:is(.el-form-card) {
    flex-direction: column;
    gap: 1rem;
    .el-card__body {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
    }
  }
}

div:is(.el-col, .el-form-item__content) {
  > .el-select,
  > .el-date-editor,
  > .el-input-number {
    width: 100%;
  }
}

// 单选按钮组
.el-radio-group {
  .el-radio:is(.is-checked) {
    .el-radio__inner {
      background-color: var(--el-color-success) !important;
      color: var(--el-color-success) !important;
    }
    .el-radio__label {
      color: var(--el-color-success) !important;
    }
  }
}

// 下拉菜单
.el-dropdown-menu {
  --el-dropdown-menuItem-hover-fill: var(--el-color-success-light-9);
  --el-dropdown-menuItem-hover-color: var(--el-color-success);
}

//树
.el-tree {
  height: 100%;
}

//文本框
.el-textarea__inner {
  &:focus {
    outline: 0;
    box-shadow: 0 0 0 1px var(--el-color-success) inset !important;
  }
}

.el-message-box {
  --el-color-primary: var(--el-color-success) !important;
  --el-color-primary-light-9: var(--el-color-success-light-9);
  --el-button-hover-bg-color: var(--el-color-success-light-3) !important;
  .el-button:is(.el-button--primary) {
    &:focus,
    &:hover {
      border-color: var(--el-color-success-light-3) !important;
      background-color: var(--el-color-success-light-3) !important;
    }
  }
}
